package com.example.model.schedule.pojo;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;

@Data
public class TaskinfoLogs implements Serializable {
    public static final int SCHEDULED=0;   //初始化状态
    public static final int EXECUTED=1;       //已执行状态
    public static final int CANCELLED=2;   //已取消状态
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "任务编号")
    private Long taskId;

    @Schema(description = "执行时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date executeTime;

    @Schema(description = "参数")
    private String parameters;

    @Schema(description = "优先级")
    private Integer priority;

    @Schema(description = "任务类型")
    private Integer taskType;

//    @Version
    @Schema(description = "版本号，用乐观锁")
    private Integer version;

    /**
     * 状态 0=int 1=EXECUTED 2=CANCELLED
     */
    @Schema(description = "状态")
    private Integer status;
}
